﻿using System;
using System.Windows.Controls;
using System.Windows.Media.Imaging;

namespace Rio.Framework.Pages.Controls.Navigation
{
    public class MenuItemViewModel : ButtonViewModel
    {

        /// <summary>
        /// Gets or sets the icon URL.
        /// </summary>
        /// <value>The icon URL.</value>
        public Uri IconUrl { get; set; }

        /// <summary>
        /// Gets or sets the icon.
        /// </summary>
        /// <value>The icon.</value>
        public Image Icon
        {
            get
            {
                if (IconUrl != null)
                {
                    return new Image()
                    {
                        Source = new BitmapImage(this.IconUrl)
                    };
                }
                return null;
            }
        }
    }
}
